Skip to content

Emit a 'modelRemoted' event by app.model() - #402

Merged
raymondfeng merged 1 commit into
masterfrom
feature/emit-model-remoted-event
Jul 25, 2014
Merged

Emit a 'modelRemoted' event by app.model()#402
raymondfeng merged 1 commit into
masterfrom
feature/emit-model-remoted-event

Conversation

@raymondfeng

Copy link
Copy Markdown
Member

/to @ritch or @bajtos

This event will be listened by loopback-explorer so that models remoted
after the explorer is initiated will be added to the api specs

This event will be listened by loopback-explorer so that models remoted
after the explorer is initiated will be added to the api specs
@bajtos

bajtos commented Jul 25, 2014

Copy link
Copy Markdown
Member

Perhaps 'model' name is good enough? Not all models in app.models() are remoted - see options.public.

@raymondfeng

Copy link
Copy Markdown
Member Author

I intend to reserve that for app.model() for any models. When app.model() is called, we can emit model event.

If we introduce the api to unregister a model from app, app can emit events such as modelRegistered, or modelUnregistered.

@raymondfeng

Copy link
Copy Markdown
Member Author

Please also note that modelRemoted event is emitted only for public models.

@bajtos

bajtos commented Jul 25, 2014

Copy link
Copy Markdown
Member

I see, that makes sense. LGTM.

raymondfeng added a commit that referenced this pull request Jul 25, 2014
@raymondfeng
raymondfeng merged commit 5aee3b7 into master Jul 25, 2014
@raymondfeng
raymondfeng deleted the feature/emit-model-remoted-event branch July 25, 2014 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants